Rewriting files

Rewriting files

am 25.08.2009 12:09:04 von zilore mumba

--0-331388445-1251194944=:16496
Content-Type: multipart/alternative; boundary="0-734957951-1251194944=:16496"

--0-734957951-1251194944=:16496
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Perl Community,
Once more thanks very much for spending precious time to look at my problem=
.. When the input file is the text below, the replacements are made.
However the text below is record N°. 1 of a binary file. Data follows aft=
er this record.
When I apply the script to the binary file no replacement is made. A sample=
of a binary file is attached.
I will continue trying based on the valuable assistance I have received.
Zilore


rec 1:0:date 2009082400 TMP kpds5=3D11 kpds6=3D100 kpds7=3D850 levels=3D(3,=
82) grid=3D255 850 mb anl:
=A0 TMP=3DTemp. [K]
=A0 timerange 1 P1 0 P2 0 TimeU 1=A0 nx 1303 ny 1 GDS grid 0 num_in_ave 0 m=
issing 0
=A0 center 98 subcenter 0 process 110 Table 1
=A0 latlon: lat=A0 90.000000 to 0.000000 by 2.500000=A0 nxny 1303
        =A0 long 0.000000 to 90.000000 by 2.500000, (1303 x=
1) scan 0 mode 128 bdsgrid 1
=A0 min/max data 268.918 284.917=A0 num bits 14=A0 BDS_Ref 268.918=A0 DecSc=
ale 0 BinScale -10


=0A
--0-734957951-1251194944=:16496
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Perl Community,
Once more thanks very much=
for spending precious time to look at my problem. When the input file is t=
he text below, the replacements are made.
However the text below is reco=
rd N°. 1 of a binary file. Data follows after this record.
When I appl=
y the script to the binary file no replacement is made. A sample of a binar=
y file is attached.
I will continue trying based on the valuable assista=
nce I have received.
Zilore


rec 1:0:date 2009082400 TMP kpds5=
=3D11 kpds6=3D100 kpds7=3D850 levels=3D(3,82) grid=3D255 850 mb anl:
&nb=
sp; TMP=3DTemp. [K]
  timerange 1 P1 0 P2 0 TimeU 1  nx 1303 n=
y 1 GDS grid 0 num_in_ave 0 missing 0
  center 98 subcenter 0 proce=
ss 110 Table 1
  latlon: lat  90.000000 to 0.000000 by 2.50000=
0  nxny 1303
         =
long 0.000000
to 90.000000 by 2.500000, (1303 x 1) scan 0 mode 128 bdsgrid 1
  m=
in/max data 268.918 284.917  num bits 14  BDS_Ref 268.918  D=
ecScale 0 BinScale -10




--0-734957951-1251194944=:16496--
--0-331388445-1251194944=:16496
Content-Type: application/octet-stream; name="T.850HPA.24H"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="T.850HPA.24H"

R1JJQgAJPAEAABwBYm7/gAtkA1IJCBgAAAEYAAAAAAAVAAAAAAAgAP8AACUA
JQFfkAAAAIAAAAABX5AJxAnEAAAAAAAACPRYgApDEJ85DgBqHQDTADwFWAAE
BgA9DxwltNAKnL2cq7y9zc3c3Nzd3t7e/t7f3uze3s3c3Ny9vNqQ9U9c9E9N
M96I9m2Jl5N5V5HNVU9d5tk89c88+Jk8/U9M9eI9s9E95U+Rs8u00p6K6+jQ
m43n2rSl2rNqszoLY+ipSUo5yBtJjvXiBqLgun9OS2c5ZbtpBe3EfoOqjgRE
qDzH0AAApVc6AACTFAAIHQPAP5KGRwPAAF5gdmk81p2Lqh40bGJYhY5Gmc5V
raNSWWX0aqnfokblp3pmXA+a/b//M4/WMlvqRzCcSBwJMoCcRl1s2rnff/+v
W1WJPx9n0//ogGZlDkEkLE7maIAKyuNRExcuwf/29vHY/Kd1bH0vh+/2BcUV
nha5idGK8V3gvvlHH+J//7e96LI/mgwsnN7ox0A51dfOmXMLhRtRNpM+1kpX
DN7DPIRT9J/6KmH9w4aZUXqF3Fjf/4RX5YVorYvXnmy4lIBUf//ULxud0i6H
hGGiSQpDuTs5S8Gwcx7LSAgHhF0esrWieX/8BGZsZYWWkNgrinHNK0+hgRaA
PKL5d/+cryn/WU0JChWzu1GeFbTTdEq6HK66YWITdGdv/6GrUa36V8xM+Zsz
YqVrLHhK7GVs2PJKmXddh//2la9SL3aTqTQHZkscypIS8kiJUG4a57GgPSyz
kat62k/tYe3KhrT68IuoND0RsRAIaYP6uN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jb2lKDBJqCpucdlmtUSzNpL0b1bbxku8o28yatqxfIg9QQh/AOXM9Ze
RgksYL/5IZasDnnNbJ2RCfWacGskTK69JLYF0/bVugH/9vg0XVp5CHMPUdB6
6+Y2Lu78dNVtNJ5/5fqeNF7+kdXWzDVG1Is2P//TKR6rbodFQa4Rj7sWVLLV
1h7CxWhgvNYmm+Umehb/9v0+4AA3Nzc3

--0-331388445-1251194944=:16496
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--0-331388445-1251194944=:16496--

Re: Rewriting files

am 25.08.2009 22:39:31 von Bill Luebkert

zilore mumba wrote:
> Perl Community,
> Once more thanks very much for spending precious time to look at my =

> problem. When the input file is the text below, the replacements are made.
> However the text below is record N°. 1 of a binary file. Data follows =

> after this record.
> When I apply the script to the binary file no replacement is made. A =

> sample of a binary file is attached.
> I will continue trying based on the valuable assistance I have received.

There is no replacement because the data you are attempting to replace is
not in that file. There is no nx or ny or nxny etc.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Rewriting files

am 26.08.2009 08:57:16 von zilore mumba

--===============1210282115==
Content-Type: multipart/alternative; boundary="0-42678744-1251269836=:36300"

--0-42678744-1251269836=:36300
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Perl Community
Sorry for misleading. I was working on the erroneous assumption that since =
I specified 'binmode' perl would find the equivalent of nx ny in binary and=
do as required. I definitely have to read on data formats and perhaps conv=
ert the file to ascci, do replacements and rewrite it in binary.
Your contribution has been really worthwhile (excuse my wasting your time),=
but am very thankful.
Zilore



--- On Tue, 8/25/09, Bill Luebkert wrote:

From: Bill Luebkert
Subject: Re: Rewriting files
To: "zilore mumba"
Cc: activeperl@listserv.activestate.com
Date: Tuesday, August 25, 2009, 11:39 PM

zilore mumba wrote:
> Perl Community,
> Once more thanks very much for spending precious time to look at my=20
> problem. When the input file is the text below, the replacements are made=
..
> However the text below is record N°. 1 of a binary file. Data follows=
=20
> after this record.
> When I apply the script to the binary file no replacement is made. A=20
> sample of a binary file is attached.
> I will continue trying based on the valuable assistance I have received.

There is no replacement because the data you are attempting to replace is
not in that file.=A0 There is no nx or ny or nxny etc.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
=0A
--0-42678744-1251269836=:36300
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Perl Community
Sorry for misleading. I was=
working on the erroneous assumption that since I specified 'binmode' perl =
would find the equivalent of nx ny in binary and do as required. I definite=
ly have to read on data formats and perhaps convert the file to ascci, do r=
eplacements and rewrite it in binary.
Your contribution has been really =
worthwhile (excuse my wasting your time), but am very thankful.
Zilore r>


--- On Tue, 8/25/09, Bill Luebkert <dbecoll@roadrunn=
er.com>
wrote:
b(16, 16, 255); margin-left: 5px; padding-left: 5px;">
From: Bill Luebke=
rt <dbecoll@roadrunner.com>
Subject: Re: Rewriting files
To: "z=
ilore mumba" <zmumba@yahoo.com>
Cc: activeperl@listserv.activestat=
e.com
Date: Tuesday, August 25, 2009, 11:39 PM

class=3D"plainMail">zilore mumba wrote:
> Perl Community,
> On=
ce more thanks very much for spending precious time to look at my
> =
problem. When the input file is the text below, the replacements are made.<=
br>> However the text below is record N°. 1 of a binary file. Data fol=
lows
> after this record.
> When I apply the script to the bin=
ary file no replacement is made. A
> sample of a binary file is atta=
ched.
> I will continue trying based on the valuable assistance I hav=
e received.

There is no replacement because the data you are attempt=
ing to replace is
not in that file.  There is no nx or ny or nxny e=
tc.
_______________________________________________
ActivePerl mailin=
g list
"/mc/compose?to=3DActivePerl@listserv.ActiveState.com">Activ ePerl@listserv.=
ActiveState.com

To unsubscribe: href=3D"http://listserv.ActiveState.com/mailman/mysubs" target=3D"_blank">=
http://listserv.ActiveState.com/mailman/mysubs
td>


--0-42678744-1251269836=:36300--

--===============1210282115==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1210282115==--